import Vue from 'vue'


import Cookies from 'js-cookie'

import 'normalize.css/normalize.css' // CSS重置的现代替代方法

import Element from 'element-ui'
import '@/styles/element-variables.scss'

import '@/styles/index.scss' // 全局css

import App from './App.vue'
import store from './store'
import router from './router'

import testPM from './utils/authentication'
Vue.prototype.testPMethod = testPM

import './permission' // 权限控制
import '@/icons' // icon图标

import * as filters from './filters' // 全局筛选器

import {  Dialog } from 'vant';
Vue.use(Dialog)

// import 'lib-flexible/flexible'

import Echarts from 'echarts'
Vue.prototype.echarts = Echarts
Vue.use(Echarts)


Vue.use(Element, {
  size: Cookies.get('size') || 'medium', // 设置元素element-ui默认大小
})

// 注册全局实用程序筛选器
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

Vue.config.productionTip = false

new Vue({
  render: h => h(App),
  router,
  store
}).$mount('#app')

// window.onload = function () {
//   console.log('window.onload ');
//   let designSize = 1920; // 设计图尺寸
//   let html = document.documentElement;
//   let wW = html.clientWidth;// 窗口宽度
//   let rem = wW * 100 / designSize;
//   document.documentElement.style.fontSize = rem + 'px';
// }

// // 绑定到窗口的这个事件中
// $(window).resize(function () {
//   console.log('$(window).resize');
//   let designSize = 1920; // 设计图尺寸
//   let html = document.documentElement;
//   let wW = html.clientWidth;// 窗口宽度
//   let rem = wW * 100 / designSize;
//   document.documentElement.style.fontSize = rem + 'px';
// });